#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/6/15 22:25
# @Author  : Lewic
# @File    : script2.py
# @Software: PyCharm
# @context : 

from models.features import FeatureClass
import tkinter as tk
from tkinter import ttk


class Script2Class(FeatureClass):
    script_name = 'script2'
    def __init__(self, master):
        super().__init__(master)
        self.create_panel1()

    def create_panel1(self):
        self.input_params = {'E': '', 'F': ''}
        self.components = [
            {'type': 'entry', 'name': 'E'},
            {'type': 'entry', 'name': 'F'}
        ]
        self.buttons = [
            {'label': 'Confirm', 'command': self.run_feature},
            {'label': 'Clear Inputs', 'command': self.clear_inputs}
        ]

    def run_feature(self):
        input_E = self.get_input_param('E').get()
        input_F = self.get_input_param('F').get()
        self.log(f"Input E: {input_E}, Input F: {input_F}")

    def confirm_action(self):
        self.run_feature()
        # 实现具体的确认动作逻辑，这里简单返回 True
        return False
